package com.zqh.apiproductcommentquery.controller;

import com.zqh.apiproductcommentquery.service.ApiProductCommentQueryService;
import com.zqh.myfmmall.result.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-03-05 23:00
 */
@RestController
@RequestMapping("productcomment/query")

public class ApiProductCommentQueryController{
    @Resource
    private ApiProductCommentQueryService apiProductCommentQueryService;

    @GetMapping("page/{pageNum}/{pageSize}/{productId}")
    public Result retrieveByProductId(@PathVariable("pageNum") Integer pageNum,
                                      @PathVariable("pageSize") Integer pageSize,
                                      @PathVariable("productId") String productId){
        return apiProductCommentQueryService.page(pageNum,pageSize,productId);
    }

    @GetMapping("retrieveCommentCount/{productId}")
    public Result retrieveCommentsCount(@PathVariable("productId") String productId){
        return apiProductCommentQueryService.retrieveCommentsCount(productId);
    }



}
